package com.example.traning.mall.controller.account.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

import static com.example.traning.mall.framework.common.consts.validation.UserRules.*;


/**
 * @author lei yu
 * @date 2024/05/22
 */
@Data
@Schema(description = "用户登录")
public class UserLoginReqVO {

    /**
     * 用户名
     */
    @NotBlank(message = MESSAGE_USERNAME_NOT_NULL)
    @Pattern(regexp = PATTERN_USERNAME, message = MESSAGE_USERNAME_PATTERN)
    @Schema(description = "用户名", example = "root", requiredMode = Schema.RequiredMode.REQUIRED)
    private String username;

    /**
     * 密码（原文）
     */
    @NotBlank(message = MESSAGE_PASSWORD_NOT_NULL)
    @Pattern(regexp = PATTERN_PASSWORD, message = MESSAGE_PASSWORD_PATTERN)
    @Schema(description = "密码", example = "123456", requiredMode = Schema.RequiredMode.REQUIRED)
    private String password;


}
